home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / t4diblib.zip / ANIMATE5.F4_ / ANIMATE5.F4
Text File  |  1995-12-11  |  4KB  |  141 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "ANIMATE5"
  6.    ClientHeight    =   1680
  7.    ClientLeft      =   1200
  8.    ClientTop       =   1572
  9.    ClientWidth     =   2880
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   1
  13.       weight          =   700
  14.       size            =   7.8
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   2100
  21.    Left            =   1152
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   1680
  24.    ScaleWidth      =   2880
  25.    Top             =   1200
  26.    Width           =   2976
  27.    Begin VBX.T4DILIB dilib1 
  28.       Caption         =   "dilib1"
  29.       ControlMode     =   0  'Lib -> PIC
  30.       Height          =   372
  31.       Index           =   4
  32.       Left            =   1680
  33.       Top             =   960
  34.       Visible         =   0   'False
  35.       Width           =   972
  36.    End
  37.    Begin VBX.T4DILIB dilib1 
  38.       Caption         =   "dilib1"
  39.       ControlMode     =   0  'Lib -> PIC
  40.       Height          =   372
  41.       Index           =   3
  42.       Left            =   1560
  43.       Top             =   840
  44.       Visible         =   0   'False
  45.       Width           =   972
  46.    End
  47.    Begin VBX.T4DILIB dilib1 
  48.       Caption         =   "dilib1"
  49.       ControlMode     =   0  'Lib -> PIC
  50.       Height          =   372
  51.       Index           =   2
  52.       Left            =   1440
  53.       Top             =   720
  54.       Visible         =   0   'False
  55.       Width           =   972
  56.    End
  57.    Begin VBX.T4DILIB dilib1 
  58.       Caption         =   "dilib1"
  59.       ControlMode     =   0  'Lib -> PIC
  60.       Height          =   372
  61.       Index           =   1
  62.       Left            =   1320
  63.       Top             =   600
  64.       Visible         =   0   'False
  65.       Width           =   972
  66.    End
  67.    Begin VB.CommandButton Command1 
  68.       Appearance      =   0  'Flat
  69.       BackColor       =   &H80000005&
  70.       Caption         =   "&Quit"
  71.       Height          =   372
  72.       Left            =   120
  73.       TabIndex        =   0
  74.       Top             =   1200
  75.       Width           =   1452
  76.    End
  77. End
  78. Attribute VB_Name = "Form1"
  79. Attribute VB_Creatable = False
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Private Declare Function GlobalFree% Lib "kernel" (ByVal h%)
  83. Private Declare Function GetFreeSpace& Lib "kernel" (ByVal x%)
  84. Dim TimeIn!
  85. Dim Frames%
  86.  
  87. Private Sub Command1_Click()
  88.  Terminate
  89. End Sub
  90.  
  91. Private Sub Form_Load()
  92. Dim loopctr%, memctr%, framectr%
  93.  Top = (Screen.Height - Height) / 2!
  94.  Left = (Screen.Width - Width) / 2!
  95. 'dilib(1) has the 'real' hLib
  96.  dilib1(1).LibraryName = "bluespin.ilb"
  97.  dilib1(1).Action = IM_ACTION_OPENLIBRARY
  98.  Show
  99.  Frames = 0
  100.  TimeIn = Timer
  101.  For memctr = 1 To 4
  102.   If memctr > 1 Then
  103. 'Clone the hLib into dilibs 2-4.
  104.    dilib1(memctr).hLib = dilib1(1).hLib
  105.   End If
  106. 'One image per dilib1.
  107.   dilib1(memctr).MemberNumber = memctr
  108.   dilib1(memctr).Action = IM_ACTION_GETMEMBER
  109.  Next
  110.  For loopctr = 1 To 100
  111.   For memctr = 1 To 4
  112.    'Disregard comments for tutorial.
  113.    'Moving image
  114.    'image1.Left = image1.Left + screen.TwipsPerPixelX
  115.    'image1.Top = image1.Top + screen.TwipsPerPixelY
  116.    'image1.Picture = dilib1(memctr).Picture
  117.    'image1.Refresh
  118.    Picture = dilib1(memctr).Picture
  119.    Frames = Frames + 1
  120.   Next memctr
  121.   DoEvents
  122.  Next loopctr
  123.  Terminate
  124. End Sub
  125.  
  126. Private Sub Form_Unload(Cancel As Integer)
  127.  End
  128. End Sub
  129.  
  130. Private Sub Terminate()
  131. Dim TimeOut!, TimeElapsed!, fps!
  132.  TimeOut = Timer
  133.  TimeElapsed = TimeOut - TimeIn
  134.  fps = Frames
  135.  fps = Frames / TimeElapsed
  136.  MsgBox Trim$(Str$(fps)) + " frames per second."
  137.  End
  138. End Sub
  139.  
  140.  
  141.